At http://pythonprogramming.net/global-local-variables/?completed=/function-parameter-defaults-python-3-basics/
def example(): print x # syntax error
You must be logged in to post. Please login or register an account.
Change it to
print(x)
In python 2.7, print was a statement, so you could do
print x
. In Python 3+, print is a function, so it needs the parenthesis.
-Harrison 11 years ago
You must be logged in to post. Please login or register an account.